import java.lang.reflect.Constructor;
import java.lang.reflect.Modifier;

public class demo {
    Constructor[] cons = Person.class.getDeclaredConstructors();

    public void ggg() {
        for (Constructor con : cons) {
            System.out.print("访问修饰符:");
            int modifier = con.getModifiers();
            if ((modifier & Modifier.PUBLIC) == Modifier.PROTECTED)
                System.out.println("public");
            else if ((modifier & Modifier.PUBLIC) == Modifier.PROTECTED)
                System.out.println("protected");
            else if ((modifier & Modifier.PUBLIC) == Modifier.PROTECTED)
                System.out.println("private");
            else
                System.out.println("default(package)");

            Class[] Params = con.getParameterTypes();
            if (Params.length == 0) {
                System.out.println("该方法没有参数");
            } else {
                System.out.println("该构造方法没有参数:[");
                for (int i = 0; i < Params.length; i++) {
                    if (i != 0) {
                        System.out.println(",");
                        System.out.println(Params[i].getName());
                    }
                    System.out.println("]");
                }
            }
        }
    }
}